home *** CD-ROM | disk | FTP | other *** search
- /* %filename% -- application methods */
- /* Created %date% %time% by AppMaker */
-
- /* We recommend that you not modify this module and instead modify */
- /* its subclass, %Appname%App. The 'z' prefix on this module marks% %*/
- /* a module which is likely to be regenerated by AppMaker after you */
- /* make changes to the user interface. The modules without the 'z' */
- /* prefix will not be regenerated by AppMaker unless you delete them. */
- /* Using a separate subclass to override the AppMaker-generated code */
- /* lets you regenerate code without losing your hand-coded changes. */
-
- #include <Commands.h>
- #include <Global.h>
- #include <CBartender.h>
- #include <CFWDesktop.h>
- #include <CWindow.h>
- #include "ResourceDefs.h"
- %for each menu gen includeAppDialogs%
- #include "%Appname%Doc.h"
- #include "z%Appname%App.h"
-
- extern OSType gSignature;
- extern CBartender *gBartender;
- extern CDesktop *gDesktop;
-
- #define kExtraMasters 4
- #define kRainyDayFund 20480
- #define kCriticalBalance 20480
- #define kToolboxBalance 20480
-
- /*----------*/
- void Z%Appname%App::I%Appname%App (void)
- {
- inherited::IApplication (kExtraMasters, kRainyDayFund,
- kCriticalBalance, kToolboxBalance);
-
- %for each dialog gen createModeless%
-
- } /* I%Appname%App */
-
- /*----------*/
- void Z%Appname%App::MakeDesktop (void)
- {
- gDesktop = new CFWDesktop;
- ((CFWDesktop *)gDesktop)->IFWDesktop (this);
-
- } /* MakeDesktop */
-
- /*----------*/
- void Z%Appname%App::SetUpMenus (void)
- {
- MenuHandle macMenu;
-
- inherited::SetUpMenus ();
- %for each menu gen setup%
-
- %for each menu gen addPopup%
-
- } /* SetUpMenus */
-
- /*----------*/
- void Z%Appname%App::CreateDocument (void)
- {
- C%Appname%Doc *theDocument;
-
- theDocument = NULL;
- TRY {
- theDocument = new C%Appname%Doc;
- theDocument->I%Appname%Doc (this, TRUE);
- theDocument->NewFile ();
- } CATCH {
- ForgetObject (theDocument);
- } ENDTRY;
-
- } /* CreateDocument */
-
- /*----------*/
- void Z%Appname%App::OpenDocument (SFReply *macSFReply)
- {
- C%Appname%Doc *theDocument;
-
- theDocument = NULL;
- TRY {
- theDocument = new C%Appname%Doc;
- theDocument->I%Appname%Doc (this, TRUE);
- theDocument->OpenFile (macSFReply);
- } CATCH {
- ForgetObject (theDocument);
- } ENDTRY;
-
- } /* OpenDocument */
-
- %if fileExists appname+App.c%
- /*----------*/
- /* This code should be in %Appname%App.c rather than in this file. */
- /* AppMaker generated it here because %Appname%App.c already existed. */
- /* AppMaker doesn't overwrite an existing non-Z file because it */
- /* might have lots of user hand-written code. */
- /*----------*/
- void Z%Appname%App::UpdateMenus (void)
- {
- inherited::UpdateMenus ();
- %for each menu gen updateAppMenus%
-
- } /* UpdateMenus */
-
- %endif%
- /*----------*/
- void Z%Appname%App::DoCommand (long theCommand)
- {
- short itemNr;
-
- switch (theCommand) {
- case cmdAbout:
- itemNr = Alert (1, NULL);
- break;
- %if fileExists appname+App.c%
- %for each menu gen handleAppItems%
- %endif%
-
- default:
- inherited::DoCommand (theCommand);
- break;
- } /* switch */
-
- } /* DoCommand */
-
- /* %filename% */
-